//
//  EventDetailViewController.h
//  FootPrint
//
//  Created by 秦 东方 on 3/19/13.
//  Copyright (c) 2013 alex tao. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "EventParser.h"
#import "GridScrollView.h"
#import "CalendarViewController.h"
#import "FriendSelViewController.h"
#import "PoiFrameViewController.h"
#import "TemplateViewController.h"
#import "PickIconViewController.h"
#import "ReminderViewController.h"

typedef enum {
    eModeMidifyEvent = 0,
    eModeCreateEvent
} eEventMode;

@interface EventDetailViewController : UIViewController <EventParserDelegate, GridScrollDelegate, UIActionSheetDelegate, CalendarPickDelegate, FriendSelDelegate, POISelDelegate, TemplateSelDelegate, PickIconDelegate, ReminderDelegate> {
    
    EventParser *                          _parser;
    
    NSDateFormatter *                      _formatter;

    EventMessage_Builder *                 _builder;
    
    NSMutableArray *                       _friendList;
    NSMutableArray *                       _canModifyFriends;
    
}


@property (retain, nonatomic) IBOutlet FPImageView *eventIcon;
@property (retain, nonatomic) IBOutlet UITextField *eventNameLabel;
@property (retain, nonatomic) IBOutlet UIButton *shopBtn;
@property (retain, nonatomic) IBOutlet UIButton *dateBtn;

@property (nonatomic, retain) EventMessage *   eventInfo;
@property (nonatomic, retain) EventBoardQueryResponseMessage *  msgArr;
@property (nonatomic) long long eventId;

@property (retain, nonatomic) IBOutlet GridScrollView *gridScroll;
@property (retain, nonatomic) IBOutlet UIView *userListView;
@property (retain, nonatomic) IBOutlet UITextField *msgText;
@property (retain, nonatomic) IBOutlet UIScrollView *contentScroll;
@property (retain, nonatomic) IBOutlet UITableView *msgTableList;
@property (retain, nonatomic) IBOutlet UIButton *btnSeeMsg;
@property (retain, nonatomic) IBOutlet UIButton *setTopBtn;
@property (retain, nonatomic) IBOutlet UILabel *memberLabel;

@property (nonatomic) eEventMode    eventMode;

- (IBAction)dismiss;
- (IBAction)switchMode:(id)sender;
- (IBAction)sendMsg;
- (IBAction)more;
- (IBAction)changeDate:(id)sender;
- (IBAction)changePOI:(id)sender;
- (IBAction)topSwitch:(id)sender;

- (void) requestById:(long long)eventId;
- (BOOL) isEventOwner;
- (BOOL) canModify;

- (void) createWithFriendList:(NSArray*)friends;
- (void) createWithTemplate:(EventMessage*)templateMsg;
- (void) createWithPOI:(MerchantMessage*)msg;

@end
